#ifndef __LIB_AGORA_CORE_EVENT_H__
#define __LIB_AGORA_CORE_EVENT_H__

#ifdef _WIN32

#ifndef AF_IPX
#include "windows.h"
#endif
#include "IEvent.h"

namespace AgoraCore
{

class	Event : public IEvent
{
public:
	Event(bool state = false);
	~Event();
	void	Set();
	void	Reset();
	void	Wait();
private:
	HANDLE	_event;
};

#else

#include <pthread.h>
#include <sys/types.h>
#include <unistd.h>
#include "IEvent.h"

namespace AgoraCore
{

class Event : public IEvent
{
public:
	Event(bool state = false);
	~Event();
	void Set();
	void Reset();
	void Wait();

private:
	pthread_mutex_t _mutex;
	pthread_cond_t _cond;
	bool _set;
};

#endif

}

#endif
